
/**
 * 【...】扩展运算符
 */
const arr = ['时间啊进士','时间简史','千年一叹']
function fun() { 
    console.log("扩展运算符：", arguments) //Arguments(3) ["时间啊进士", "时间简史", "千年一叹", callee: ƒ, Symbol(Symbol.iterator): ƒ]
}

fun(...arr)

/**
 * 2、扩展运算符可将数组转成参数序列
 */

const arr1 = [1,2,3,4]
const arr2 = [5, 6, 7, 8]

const array = [...arr1, ...arr2]
console.log('array:', array) //array: (8) [1, 2, 3, 4, 5, 6, 7, 8]

/**
 * 3、将伪数组转成真正数组
 */

const dom = document.querySelectorAll('div')
const arrDom = [...dom]
console.log(arrDom) //(4) [div.container, div.item, div.item, div.item]